﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ExpressionEngine
{
    /// <summary>
    /// 表达式一般性操作符号
    /// </summary>
    public class OperationSymbol : Symbol
    {
        /// <summary>
        /// 操作符操作数个数
        /// </summary>
        private int _dimension;
        public int Dimension
        {
            get { return _dimension; }
            set { _dimension = value; }
        }

        /// <summary>
        /// 操作符的操作数
        /// </summary>
        private List<Variable> _operands = new List<Variable>();
        public List<Variable> Operands
        {
            get { return _operands; }
            set { _operands = value; }
        }

        /// <summary>
        /// 操作运算，应该被每一个具体的操作符实现
        /// </summary>
        /// <returns></returns>
        public virtual Variable operate()
        {
            throw new Exception("找不到操作符的具体实现");
        }

        /// <summary>
        /// 操作符优先级
        /// </summary>
        private int _priority;
        public int Priority
        {
            get { return _priority; }
            set { _priority = value; }
        }
    }
}
